import java.io.File;

public class lesson921huijie {
    public static void main(String[] args) {
        File f = new File("D:\\pythonProject3");//指向文件夹
       File[] files = f.listFiles();
        //list列表，集合
        String[] list = f.list();//String类型的数组
        for (int i = 0; i < list.length; i++) {
            System.out.println(list[i]);
       String name = files[i].getName();
            if (name.endsWith(".py")){
                files[i].delete();
            }
        }

    }
}
